import os
import operator
import csv


maxlat = 0
maxlon = 0
minlat = 50
minlon = 20
for i in range(400):
    filename = './cluster/' + str(i) + '.csv'
    if not os.path.exists(filename):
        pass
    else:
        #print(i)
        with open(filename, "r") as f:
                reader = csv.reader(f)
                for row in reader:
                    lat = float(row[1])
                    lon = float(row[2])
                    if lat > maxlat:
                        maxlat = lat
                    if lat < minlat:
                        minlat = lat
                    if lon > maxlon:
                        maxlon = lon
                    if lon < minlon:
                        minlon = lon
    
print(minlat, ',', minlon)
print(maxlat, ',', maxlon)
                    